import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertEquals;

/**
 * 软件测试实验一：构建软件测试实验环境
 */
class TriangleTest1 {

    @Test
    public void testIllegalLength() {
        assertEquals("输入错误", Triangle.classify(200, 2, 2));
        assertEquals("输入错误", Triangle.classify(-1, 2, 2));
        assertEquals("输入错误", Triangle.classify(2, 200, 3));
        assertEquals("输入错误", Triangle.classify(2, -1, 3));
        assertEquals("输入错误", Triangle.classify(2, 2, 200));
        assertEquals("输入错误", Triangle.classify(2, 2, -1));
    }

    @Test
    public void testNotTriangle() {
        assertEquals("非三角形", Triangle.classify(2, 2, 4));
        assertEquals("非三角形", Triangle.classify(3,6,3 ));
    }

    @Test
    public void testEquilateralTriangle() {
        assertEquals("等边三角形", Triangle.classify(10, 10, 10));
    }

    @Test
    public void testIsoscelesTriangle() {
        assertEquals("等腰三角形", Triangle.classify(2, 2, 3));
        assertEquals("等腰三角形", Triangle.classify(3, 4, 3));
        assertEquals("等腰三角形", Triangle.classify(4, 3, 3));
    }

    @Test
    public void testCommonTriangle() {
        assertEquals("一般三角形", Triangle.classify(3, 4, 5));
        assertEquals("一般三角形", Triangle.classify(4, 5, 6));
    }
}
